package com.bogewang.member.service;

import com.bogewang.core.base.BaseResponse;
import com.bogewang.member.entity.LoginDTO;
import com.bogewang.member.entity.UserDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Api(tags = "会员服务接口")
public interface MemberService {

    /**
     * 根据手机号码查询是否已经存在,如果存在返回用户信息;
     * @param mobile
     * @return
     */
    @ApiOperation(value =  "根据手机号码查询是否已经存在")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "mobile", dataType = "String", required = true, value = "用户手机号码")
    })
    @PostMapping("/existMobile")
    BaseResponse<UserDTO> existMobile(@RequestParam("mobile") String mobile) throws Exception;

    /**
     * 根据token查询用户信息
     *
     * @param token
     * @return
     */
    @GetMapping("/getUserInfo")
    @ApiOperation(value = "/getUserInfo")
    BaseResponse<UserDTO> getInfo(@RequestParam("token") String token);

    /**
     * sso认证系统登录接口;
     * @param loginDTO
     * @return
     */
    @PostMapping("/ssoLogin")
    BaseResponse<UserDTO> ssoLogin(@RequestBody LoginDTO loginDTO);

}
